home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr34 / jam125sw.zip / CHKALL.BAT < prev    next >
DOS Batch File  |  1995-03-10  |  2KB  |  96 lines

  1. @echo off
  2.  
  3. rem JAM R1.20, CHKALL.BAT -- checks all existing JAM drives
  4. rem Sun Oct 9 1994, written by George A. Reznik.
  5. rem Copyright (c) 1992-1994 JAM Software.
  6. rem All Rights Reserved.
  7.  
  8. goto entry
  9.  
  10. :usage
  11. echo Checks all existing JAM drives.
  12. echo Use:
  13. echo     CHKALL [/?] [/Q ! /V] [/F] [D1: D2: ...]
  14. echo Where:
  15. echo    /Q    Quiet mode
  16. echo    /V    Verbose displays of file names encountered
  17. echo    /F    Fixes errors on disk(s)
  18. goto end
  19.  
  20. :addopt2
  21. set nomsg=1
  22. if "%nomsg%" == "" goto end
  23.  
  24. :addopt
  25. if not "%chkopt%" == "" goto add
  26. set chkopt=/V/F/C/E/T/X/N/A
  27. if "%chkopt%" == "" goto end
  28. set chkopt=
  29.  
  30. :add
  31. set chkopt=%chkopt%%1
  32.  
  33. :next
  34. shift
  35.  
  36. :entry
  37. if "%1" == "" chkall A: B: C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:
  38.  
  39. for %%o in (Q q) do if /%%o == %1 goto addopt2
  40. for %%o in (V F C E T N A v f c e t n a) do if /%%o == %1 goto addopt
  41.  
  42. if not "%nomsg%" == "" goto ishlp
  43.  
  44. echo CHKALL 1.20  Copyright (c) JAM Software, 1992-1994. All rights reserved.
  45. echo:
  46.  
  47. set nomsg=1
  48. if "%nomsg%" == "" goto end
  49.  
  50. :ishlp
  51. if "%1" == "/?" goto usage
  52. if "%1" == "/H" goto usage
  53. if "%1" == "/h" goto usage
  54.  
  55. for %%d in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if %%d: == %1 goto chkcmd
  56. for %%d in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if %%d: == %1 goto chkcmd
  57.  
  58. echo Invalid parameter: %1 !!!
  59. goto end
  60.  
  61. :chkcmd
  62. if not exist chkdrv.bat goto build
  63. if exist jam.bat goto run
  64.  
  65. :build
  66. echo Building secondary command file ...
  67.  
  68. echo if "%%4" == "available" goto end    >  jam.bat
  69. echo if "%%5" == "[Locked]" goto end    >> jam.bat
  70. echo jchkdsk %%2 %chkopt%        >> jam.bat
  71. echo if not errorlevel 1 goto end    >> jam.bat
  72. echo pause                >> jam.bat
  73. echo :end                >> jam.bat
  74. if not exist jam.bat goto cerror
  75.  
  76. :run
  77. echo Analyzing drive %1 ... 
  78.  
  79. jmount /q %1 > chkdrv.bat
  80. if errorlevel 2 goto end
  81. if errorlevel 1 goto next
  82. if not exist chkdrv.bat goto cerror
  83.  
  84. call chkdrv.bat
  85. goto next
  86.  
  87. :cerror
  88. echo Cannot create a file on current drive.
  89.  
  90. :end
  91. if exist chkdrv.bat del chkdrv.bat
  92. if exist jam.bat del jam.bat
  93. if not "%chkopt%" == "" set chkopt=
  94. if not "%nomsg%" == "" set nomsg=
  95.  
  96.